import config from '@/config'
import { http } from '@/api/request'

export default {
    lang: {
        list: {
            url: `${config.API_URL}/maintenance/lang/list`,
            name: '语言列表',
            get: async function (data = {}, config = {}) {
                return http.get(this.url, data, config)
            }
        },
        edit: {
            url: `${config.API_URL}/maintenance/lang/edit`,
            name: '编辑语言',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        },
        batchDel: {
            url: `${config.API_URL}/maintenance/lang/batchDel`,
            name: '批量删除语言',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        }
    },
    langCountry: {
        list: {
            url: `${config.API_URL}/maintenance/langCountry/list`,
            name: '地区列表',
            get: async function (data = {}) {
                return http.get(this.url, data, {
                    headers: {
                        //'response-status': 401
                    }
                })
            }
        },
        edit: {
            url: `${config.API_URL}/maintenance/langCountry/edit`,
            name: '编辑地区',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        },
        batchDel: {
            url: `${config.API_URL}/maintenance/langCountry/batchDel`,
            name: '批量删除地区',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        }
    },
    langTranslation: {
        list: {
            url: `${config.API_URL}/maintenance/langTranslation/list`,
            name: '翻译列表',
            get: async function (data = {}) {
                return http.get(this.url, data, {
                    headers: {
                        //'response-status': 401
                    }
                })
            }
        },
        edit: {
            url: `${config.API_URL}/maintenance/langTranslation/edit`,
            name: '编辑翻译',
            post: async function (data = {}, config = {}) {
                return http.post(this.url, data, config)
            }
        },
        batchDel: {
            url: `${config.API_URL}/maintenance/langTranslation/batchDel`,
            name: '批量删除翻译',
            post: async function (data = {}) {
                return http.post(this.url, data, {
                    headers: {
                        //'response-status': 401
                    }
                })
            }
        },
        robotTranslate: {
            url: `${config.API_URL}/maintenance/langTranslation/robotTranslate`,
            name: '机器翻译',
            post: async function (data = {}) {
                return http.post(this.url, data, {
                    headers: {
                        //'response-status': 401
                    }
                })
            }
        },
        json: {
            url: `${config.API_URL}/maintenance/langTranslation/json`,
            name: '语言翻译包',
            get: async function (data = {}) {
                return http.get(this.url, data, {
                    headers: {
                        //'response-status': 401
                    }
                })
            }
        }
    },
    devTools: {
        getPageSchema: {
            url: '动态赋值',
            name: '获取amis页面结构',
            get: async function (data = {}, config = {}) {
                return http.get(this.url, data, config)
            }
        },
        editParse: {
            url: `${config.API_URL}/maintenance/devTools/editParse`,
            name: '获取PHP代码',
            get: async function (data = {}, config = {}) {
                return http.get(this.url, data, config)
            }
        }
    }
}
